import http from "@/http"
import type { CommentTable } from "@/api/comment/commentModel"

//添加菜谱
export const addCommentApi  = (parm:CommentTable)=>{
    return http.post("/api/comment/addcomment",parm)
}
//查询菜谱
export const getCommentApi = (parm:CommentTable)=>{
    return http.post("/api/comment/getcomment",parm)
}
//删除评论
export const deleteCommentApi =(commentId:string)=>{
    return http.delete(`/api/comment/deletecomment/${commentId}`)
}


// -----------------管理员方法----------------------//


//管理员条件分页查询所有菜谱
export const adminGetCommentApi = (page:number,pageSize:number,searchQuery?:string,status?:string)=>{
    return http.get("/api/comment/adgetcomment",{ page, pageSize, searchQuery ,status})
}
//
export const adminEditCommentListApi = (commentList:CommentTable[],adminId:string)=>{
    return http.post("/api/comment/adeditcomment",{commentList,adminId})
}